<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="UTF-8">
	<title>goal</title>
	<link rel="stylesheet" href="css/bootstrap.min.css" />
	<link rel="stylesheet" href="css/style.css" />
</head>
<body>
	<div class="container">
		<!--header start-->
		<%@ include file="include/top.jsp" %>
		<!--header end-->
		<div class="content">
			<div class="row">
				<div class="span9">
					<div class="list">
						<span><i class="icon-list"></i>目标</span>
						<div class="btn-group">
							  <button class="btn btn-info"><i class="icon-cog"></i>操作</button>
							  <button class="btn dropdown-toggle btn-info" data-toggle="dropdown">
								<span class="caret"></span>
							  </button>
							  <ul class="dropdown-menu">
							  <c:if test="${ep.role=='manager'}">
								<li><a href="addgoal.jspx"><i class="icon-plus"></i>添加新目标</a></li>
							  </c:if>
								<li><a href="alltask.jspx"><i class="icon-zoom-in"></i>浏览所有任务</a></li>
							  </ul>
						</div>
					</div>
					<c:forEach items="${requestScope.page.list}" var="goal">
						<ul class="listcontent">
							<li class="title"><a href="tasklist.jspx?id=${goal.id }">${goal.name}</a><span class="edit"><i class="icon-edit"></i><a href="goaledit.jspx?id=${goal.id }">编辑</a></span></li>
							<li class="desc">${goal.desc}</li>
							<li>
								<c:if test="${goal.rate == 0}">
									<div class="progress progress-warning progress-striped">
								  		<div class="bar" style="width: ${goal.rate}%"></div>
									</div>
								</c:if>
								<c:if test="${goal.rate > 0 and goal.rate <= 30}">
									<div class="progress progress-info progress-striped">
								  		<div class="bar" style="width: ${goal.rate}%">已完成${goal.rate }%</div>
									</div>
								</c:if>
								<c:if test="${goal.rate > 30 and goal.rate <= 90}">
									<div class="progress progress-warning progress-striped">
								  		<div class="bar" style="width: ${goal.rate}%">已完成${goal.rate }%</div>
									</div>
								</c:if>
								<c:if test="${goal.rate > 90 and goal.rate <= 99}">
									<div class="progress progress-danger progress-striped">
								  		<div class="bar" style="width: ${goal.rate}%">已完成${goal.rate }%</div>
									</div>
								</c:if>
								<c:if test="${goal.rate == 100}">
									<div class="progress progress-success progress-striped">
								  		<div class="bar" style="width: ${goal.rate}%">已完成${goal.rate }%</div>
									</div>
								</c:if>
							</li>
						</ul>
					</c:forEach>
					<br/><br/>
					<c:if test="${empty page.list }">
						<ul class="listcontent">
							<li class="title">你还没有添加任何目标！</li>
						</ul>
					</c:if>
					<c:if test="${page.totalPage > 1}">
						<div class="pagination pagination-centered">
						  <ul>
							<c:choose>
								<c:when test="${page.pageNum == 1}">
									<li><a>首页</a></li>
									<li><a>上一页</a></li>
								</c:when>
								<c:otherwise>
									<li><a href="goallist.jspx?p=1">首页</a></li>
									<li><a href="goallist.jspx?p=${page.pageNum-1}">上一页</a></li>
								</c:otherwise>
							</c:choose>
							<c:choose>
								<c:when test="${page.pageNum == page.totalPage}">
									<li><a>下一页</a></li>
							  		<li><a>尾页</a></li>
								</c:when>
								<c:otherwise>
									<li><a href="goallist.jspx?p=${page.pageNum+1}">下一页</a></li>
							  		<li><a href="goallist.jspx?p=${page.totalPage}">尾页</a></li>
								</c:otherwise>
							</c:choose>
						 </ul>
						</div>
					</c:if>
					
				</div>
				<div class="span3"></div>
			</div>
		</div>
		<div class="footer">
			<p>Copyright © 2013 xxx版权所有</p>
		</div>
	</div>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>

</body>
</html>